Skip to main content

Adapter

The Adapter design pattern converts the interface of a class into another interface clients expect. This design pattern lets classes work together that couldn't otherwise because of incompatible interfaces.

Usage     Usage     Medium-high

UML class diagram

A visualization of the classes and objects participating in this pattern.

diagram

Sample code

This structural code demonstrates the Adapter pattern which maps the interface of one class onto another so that they can work together. These incompatible classes may come from different libraries or frameworks.


Output


See also